package cn.jilian.dao;

import java.util.Collection;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import cn.jilian.entity.Unit;



public interface UnitDAO extends JpaRepository<Unit, Long> {

	@Query(value="select max(seq) as max from Unit where fid=?1 and rank=?2")
	Integer getMaxSeq(Long fid,Integer rank);
	
	Unit findByText(String unitText);
	
	Collection<Unit> findByFidOrderBySeq(Long fid);
	
}
